package huangxin.springmvc.web.controller;

import javax.servlet.http.HttpServletResponse;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/users")
public class UserController {
    @RequestMapping("/hello")
    public void hello(HttpServletResponse response) throws Exception {
        System.out.println("hello");

        response.setHeader("Content-Type", "application/json; charset=UTF-8");
        response.getWriter().print("{\"id\":1,\"name\":\"Allen\"}");
    }
}
